package dao.jpa;

import java.util.List;

import vo.Source;
import dao.SourceDAO;

public class SourceDAOJpaImpl extends GenericDaoJpaImpl<Source, Long> implements SourceDAO {

	public SourceDAOJpaImpl() {
		super(Source.class);
	}

	public List<Source> findByCategoryId(long categoryId) {
		return super.executeFinder("Source.findByCategoryId", categoryId);
	}

	public List<Source> findAll() {
		return super.executeFinder("Source.findAll");
	}

	public List<Source> findByName(int start, int pageSize, String name) {
		return super.executeFinderPage("Source.findByName", start, pageSize, name);
	}

	public List<Source> findByType(int start, int pageSize, String type) {
		return super.executeFinderPage("Source.findByType", start, pageSize, type);
	}

	public List<Source> findByNameType(int start, int pageSize, String name, String type) {
		return super.executeFinderPage("Source.findByNameType", start, pageSize, name, type);
	}

	public List<Source> findAll(int start, int pageSize) {
		return super.executeFinderPage("Source.findAll", start, pageSize);
	}

	public long findTotalCount() {
		return super.executeFinderCount("Source.findTotalCount");
	}

	public long findTotalCountByName(String name) {
		return super.executeFinderCount("Source.findTotalCountByName",name);
	}
	public long findTotalCountByType(String type) {
		return super.executeFinderCount("Source.findTotalCountByType",type);
	}
	public long findTotalCountByNameType(String name,String type) {
		return super.executeFinderCount("Source.findTotalCountByNameType",name,type);
	}
	public Source getById(long id) {
		return super.read(id);
	}
	public Source getByEntry(String entry) {
		return super.executeSingleFinder("Source.findByEntry",entry);
	}

	public void update(long id) {
		Source source = super.read(id);
		super.update(source);
	}

	public void delete(long id)// 不是真是删除
	{
		Source source = super.read(id);
		super.delete(source);
	}

}
